package org.zxp.reflect;

import lombok.Data;
import org.apache.poi.ss.formula.functions.T;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: effectiveJava
 * @description:
 * @author: X-Pacific zhang
 * @create: 2020-12-08 17:03
 **/
public class TestReflect {
    public static void main(String[] args) throws InstantiationException, IllegalAccessException {
        Map<String,String> map = new HashMap<>();
        map.put("a","zxp");
        map.put("b","1");


        TestRef obj = getObj(TestRef.class);
        System.out.println(obj);
    }

    public static <T> T getObj(Class<T> clazz) throws IllegalAccessException, InstantiationException {
        T t = clazz.newInstance();
        return t;
    }

    @Data
    public static class TestRef{
        private String a;
        private Integer b;
    }
}
